package demo9;

public class StringBuliderDemo {

    public static void main(String[] args) {
        StringBuffer sb = new StringBuffer("Hello");
        sb.append(" World");
        System.out.println(sb);

        sb.insert(6, "Java ");
        System.out.println(sb);

        sb.delete(5, 10);
        System.out.println(sb);

        sb.replace(6, 11, "Java");
        System.out.println(sb);

        sb.reverse();
        System.out.println(sb);

        System.out.println(sb.subSequence(0,4));

        String result = sb.toString();
        System.out.println(result);
    }
}
